﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class MaximalSequenceOfEqualElements
{
    static void Main()
    {
        int[] arr = { 4, 4, 2, 1, 3, 3, 3, 2, 2, 1 };
        SeqOfEqualElements(arr);
    }

    static void SeqOfEqualElements(int[] arr)
    {
        int value = int.MinValue;
        int count = 1;
        int maxCount = 1;
        for (int i = 0; i < arr.Length - 1; i++)
        {
            if (arr[i] == arr[i + 1])
            {
                count++;
                if (count > maxCount)
                {
                    maxCount = count;
                    value = arr[i];
                }
            }

            else
            {
                count = 1;
            }
        }

        for (int i = 0; i < maxCount - 1; i++)
        {
            Console.Write(value + ", ");
        }
        Console.WriteLine(value);
    }
}

